<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // https://leetcode-cn.com/problems/reshape-the-matrix/
        // 麻了，又是感觉一眼暴力
        // 最简单的 indexOf居然给忘了,直接判断与原数组长度是否相同
        var containsDuplicate = function(nums) {
            let map = new Map();
            for (let item of nums) {
                if (!map.has(item)) {
                    map.set(item, 1);
                } else {
                    let count = map.get(item);
                    map.set(item, count + 1);
                }
            }
            return Array.from(map.values()).some(item => {
                return item > 1
            })
        };
        console.log(containsDuplicate([1,2,3,1])); 
    </script>
</body>
</html>